package startup.tws;
import com.ats.api.Connection
import com.ats.impl.tws.ConnectionImpl
import com.ats.impl.tws.TwsAdapter
import java.lang.Exception
import akka.actor.ActorSystem
import akka.actor.Actor
import akka.actor.Props
import akka.event.Logging
import akka.dispatch.Future
import com.ats.impl.actors.akka.RequestTickData

object startup extends App {
  try{
    val adapter: TwsAdapter = new TwsAdapter()
    val connection: Connection = new ConnectionImpl(adapter);
    connection.connect();
    var counter:Int=0;
    while(!connection.isConnected()){
      counter=counter+1;
      Thread.sleep(100);
    }
  // Connection established



  while(true){
    Thread.sleep(100000);
  }  



    // Disconnecting
    connection.disconnect();
  }catch{
    case ex:Exception => {
    	ex.printStackTrace();
    }
  }
}

